#include <iostream>
#include <vector>
#include <climits>
using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;
    vector<int> v(n);
    for (int i = 0; i < n; ++i)
    {
        cin >> v[i];
    }

    int l = 0, r = n - 1;
    int sum = 0;
    for (int left = 0, right = 0; right < n; ++right)
    {
        sum += v[right];
        while (sum >= m)
        {
            if (right - left < r - l)
            {
                l = left;
                r = right;
            }
            sum -= v[left++];
        }
    }

    cout << l+1 << " " << r+1 << endl;

    return 0;
}

class Solution {
public:
    vector<int> twoSum(vector<int>& price, int target) {
        int left = 0, right = price.size() - 1;
        while (left < right)
        {
            int sum = price[left] + price[right];
            if (sum > target)
                --right;
            else if (sum < target)
                ++left;
            else
                return { price[left], price[right] };
        }
        return { -1,-1 };
    }
};




//#include <iostream>
//#include <string>
//#include <cctype>
//#include <vector>
//using namespace std;
//
//int main()
//{
//    string str;
//    getline(cin, str);
//
//    int pos = 0;
//    vector<char> ret;
//    ret.emplace_back(toupper(str[pos]));
//    while (pos != -1)
//    {
//        pos = str.find(' ', pos + 1);
//        if (pos == -1)
//        {
//            break;
//        }
//        ret.emplace_back(toupper(str[pos+1]));
//    }
//
//    for (auto& c : ret)
//    {
//        cout << c;
//    }
//
//    return 0;
//}
